package com.anhry.app.safety.manage.system.bean;

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * TbUser generated by MyEclipse Persistence Tools
 */
@Entity
@Table(name = "TB_USER")
@SequenceGenerator(name = "TB_USER_SEQ", sequenceName = "TB_USER_SEQ", allocationSize = 1)
public class TbUser implements java.io.Serializable {

	// Fields

	private Long id;

	private TbUserGrade tbUserGrade;

	private TbUserRole tbUserRole;

	private TbUserDept tbUserUnit;//单位

	private TbUserDept tbUserStreet;

	private TbUserDept tbUserDept;//部门

	private String userName;//用户登录名称

	private String userRealName;//用户真实姓名

	private String userSex;//性别 0:女1：男

	private String userPwd;//密码

	private String userPwd2;//

	private Date userLoginTime;//最后登录时间

	private Integer userLoginCount;//登录次数

	private String userLoginIp;//最后登录ip

	private Date userBirthday;//出生日期

	private String userPhone;//电话（手机）

	private String userEmail;//邮件

	private Date userAddTime;//添加时间

	private Date userDeleTime;//删除时间

	private String userZw;//职务 1：局长 2：副局长 3：处长 4：副处长 5：科长 6：副科长 7：主任 8：副主任 9：科员 10:股长, 11:股员
	
	private String isLock;//是否锁定 0：正常1：锁定
	
	private String isDele;//是否删除 0：正常1：删除（在系统中其他模块均与用户有关联，所有用户的删除为逻辑删除）

	// Constructors

	/** default constructor */
	public TbUser() {
	}

	/** minimal constructor */
	public TbUser(Long id) {
		this.id = id;
	}

	/** full constructor */
	public TbUser(Long id, TbUserGrade tbUserGrade, TbUserRole tbUserRole,
			TbUserDept tbUserUnit, TbUserDept tbUserStreet,
			TbUserDept tbUserDept, String userName,
			String userRealName, String userSex, String userPwd,
			String userPwd2, Date userLoginTime, Integer userLoginCount,
			String userLoginIp, Date userBirthday, String userPhone,
			String userEmail, Date userAddTime, Date userDeleTime, String userZw,
			String isLock,String isDele) {
		this.id = id;
		this.tbUserGrade = tbUserGrade;
		this.tbUserRole = tbUserRole;
		this.tbUserUnit = tbUserUnit;
		this.tbUserStreet = tbUserStreet;
		this.tbUserDept = tbUserDept;
		this.userName = userName;
		this.userRealName = userRealName;
		this.userSex = userSex;
		this.userPwd = userPwd;
		this.userPwd2 = userPwd2;
		this.userLoginTime = userLoginTime;
		this.userLoginCount = userLoginCount;
		this.userLoginIp = userLoginIp;
		this.userBirthday = userBirthday;
		this.userPhone = userPhone;
		this.userEmail = userEmail;
		this.userAddTime = userAddTime;
		this.userDeleTime = userDeleTime;
		this.userZw = userZw;
		this.isLock = isLock;
		this.isDele = isDele;
	}

	// Property accessors
	@Id
	@Column(name = "ID", precision = 11, scale = 0)
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "TB_USER_SEQ")
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@ManyToOne(cascade = {CascadeType.REFRESH}, fetch = FetchType.EAGER)
	@JoinColumn(name = "GRADE_ID")
	public TbUserGrade getTbUserGrade() {
		return this.tbUserGrade;
	}

	public void setTbUserGrade(TbUserGrade tbUserGrade) {
		this.tbUserGrade = tbUserGrade;
	}

	@ManyToOne(cascade = {CascadeType.REFRESH}, fetch = FetchType.LAZY)
	@JoinColumn(name = "ROLE_ID")
	public TbUserRole getTbUserRole() {
		return this.tbUserRole;
	}

	public void setTbUserRole(TbUserRole tbUserRole) {
		this.tbUserRole = tbUserRole;
	}

	@ManyToOne(cascade = {CascadeType.REFRESH}, fetch = FetchType.LAZY)
	@JoinColumn(name = "UNIT_ID")
	public TbUserDept getTbUserUnit() {
		return this.tbUserUnit;
	}

	public void setTbUserUnit(TbUserDept tbUserUnit) {
		this.tbUserUnit = tbUserUnit;
	}

	@ManyToOne(cascade = {CascadeType.REFRESH}, fetch = FetchType.LAZY)
	@JoinColumn(name = "STREET_ID")
	public TbUserDept getTbUserStreet() {
		return this.tbUserStreet;
	}

	public void setTbUserStreet(TbUserDept tbUserStreet) {
		this.tbUserStreet = tbUserStreet;
	}

	@ManyToOne(cascade = {CascadeType.REFRESH}, fetch = FetchType.LAZY)
	@JoinColumn(name = "DEPT_ID")
	public TbUserDept getTbUserDept() {
		return this.tbUserDept;
	}

	public void setTbUserDept(TbUserDept tbUserDept) {
		this.tbUserDept = tbUserDept;
	}

	@Column(name = "USER_NAME", length = 100)
	public String getUserName() {
		return this.userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	@Column(name = "USER_REAL_NAME", length = 100)
	public String getUserRealName() {
		return this.userRealName;
	}

	public void setUserRealName(String userRealName) {
		this.userRealName = userRealName;
	}

	@Column(name = "USER_SEX", length = 1)
	public String getUserSex() {
		return this.userSex;
	}

	public void setUserSex(String userSex) {
		this.userSex = userSex;
	}

	@Column(name = "USER_PWD", length = 56)
	public String getUserPwd() {
		return this.userPwd;
	}

	public void setUserPwd(String userPwd) {
		this.userPwd = userPwd;
	}

	@Column(name = "USER_PWD2", length = 56)
	public String getUserPwd2() {
		return this.userPwd2;
	}

	public void setUserPwd2(String userPwd2) {
		this.userPwd2 = userPwd2;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "USER_LOGIN_TIME", length = 7)
	public Date getUserLoginTime() {
		return this.userLoginTime;
	}

	public void setUserLoginTime(Date userLoginTime) {
		this.userLoginTime = userLoginTime;
	}

	@Column(name = "USER_LOGIN_COUNT", precision = 11, scale = 0)
	public Integer getUserLoginCount() {
		return this.userLoginCount;
	}

	public void setUserLoginCount(Integer userLoginCount) {
		this.userLoginCount = userLoginCount;
	}

	@Column(name = "USER_LOGIN_IP", length = 32)
	public String getUserLoginIp() {
		return this.userLoginIp;
	}

	public void setUserLoginIp(String userLoginIp) {
		this.userLoginIp = userLoginIp;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "USER_BIRTHDAY", length = 7)
	public Date getUserBirthday() {
		return this.userBirthday;
	}

	public void setUserBirthday(Date userBirthday) {
		this.userBirthday = userBirthday;
	}

	@Column(name = "USER_PHONE", length = 32)
	public String getUserPhone() {
		return this.userPhone;
	}

	public void setUserPhone(String userPhone) {
		this.userPhone = userPhone;
	}

	@Column(name = "USER_EMAIL", length = 32)
	public String getUserEmail() {
		return this.userEmail;
	}

	public void setUserEmail(String userEmail) {
		this.userEmail = userEmail;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "USER_ADD_TIME", length = 7)
	public Date getUserAddTime() {
		return this.userAddTime;
	}

	public void setUserAddTime(Date userAddTime) {
		this.userAddTime = userAddTime;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "USER_DELE_TIME", length = 7)
	public Date getUserDeleTime() {
		return this.userDeleTime;
	}

	public void setUserDeleTime(Date userDeleTime) {
		this.userDeleTime = userDeleTime;
	}

	@Column(name = "USER_ZW", length = 32)
	public String getUserZw() {
		return this.userZw;
	}

	public void setUserZw(String userZw) {
		this.userZw = userZw;
	}
	
	@Column(name = "IS_DELE", length = 1)
	public String getIsDele() {
		return isDele;
	}

	public void setIsDele(String isDele) {
		this.isDele = isDele;
	}

	@Column(name = "IS_lOCK", length = 1)
	public String getIsLock() {
		return isLock;
	}

	public void setIsLock(String isLock) {
		this.isLock = isLock;
	}

}